﻿<Window x:Class="tsge.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:controls="clr-namespace:tsge.Controls"
        Background="#FF7A7C82" Title="Terraria Save Game Editor - v1.0.0" Height="525" Width="525"
        ResizeMode="CanMinimize" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow">
    
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
           Window Resources
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
    
    <Window.Resources>
        <!-- Terraria Image List For Hair Selector -->
        <controls:TerrariaImageList x:Key="terrHairList" />
    </Window.Resources>
    
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
           Main Window
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
            
        <!-- Menu Definitions -->
        <Menu Grid.Row="0" Height="22" HorizontalAlignment="Stretch" VerticalAlignment="Top">
            <MenuItem Header="File" HorizontalAlignment="Center" HorizontalContentAlignment="Center" SnapsToDevicePixels="True" VerticalAlignment="Center" VerticalContentAlignment="Center">
                <MenuItem.Icon>
                    <Image Source="/tsge;component/Icons/disk.png" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" />
                </MenuItem.Icon>
                <MenuItem x:Name="mnuFile_New" Header="New" Click="mnuFile_New_Click">
                    <MenuItem.Icon>
                        <Image Source="/tsge;component/Icons/status_online.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem x:Name="mnuFile_Open" Header="Open" Click="mnuFile_Open_Click">
                    <MenuItem.Icon>
                        <Image Source="/tsge;component/Icons/folder_user.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem x:Name="mnuFile_Save" Header="Save" Click="mnuFile_Save_Click">
                    <MenuItem.Icon>
                        <Image Source="/tsge;component/Icons/page_save.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <MenuItem x:Name="mnuFile_SaveAs" Header="Save As" Click="mnuFile_SaveAs_Click">
                    <MenuItem.Icon>
                        <Image Source="/tsge;component/Icons/script_save.png" />
                    </MenuItem.Icon>
                </MenuItem>
                <Separator />
                <MenuItem x:Name="mnuFile_Exit" Header="Exit" Click="mnuFile_Exit_Click">
                    <MenuItem.Icon>
                        <Image Source="/tsge;component/Icons/stop.png" />
                    </MenuItem.Icon>
                </MenuItem>
            </MenuItem>
            <MenuItem x:Name="mnuAbout" Header="About" SnapsToDevicePixels="True" HorizontalAlignment="Center" VerticalAlignment="Center" Click="mnuAbout_Click">
                <MenuItem.Icon>
                    <Image Source="/tsge;component/Icons/information.png" HorizontalAlignment="Center" VerticalAlignment="Center" Stretch="None" />
                </MenuItem.Icon>
            </MenuItem>
        </Menu>
        
        <!-- Character Editor Control -->
        <controls:CharacterEditor x:Name="ceMainEditor" Grid.Row="1" DataContext="{Binding}" 
                                  HorizontalAlignment="Stretch" VerticalAlignment="Stretch" 
                                  HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch" 
                                  />

        
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            Hair Selector Panel
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

        <Grid x:Name="HairSelector" Grid.Row="1" Background="Transparent" Visibility="Collapsed">
            <Rectangle x:Name="rcHairSelector"
                   HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
                   Fill="#AA000000"
                   />
            <Grid VerticalAlignment="Center" HorizontalAlignment="Center">
                <Grid.RowDefinitions>
                    <RowDefinition Height="200" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>

                <ListBox x:Name="lstHairList" Grid.Row="0" Margin="5" ItemsSource="{Binding Source={StaticResource terrHairList}}"
                         ScrollViewer.HorizontalScrollBarVisibility="Disabled" Width="300">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Border BorderBrush="#33000000" BorderThickness="1">
                                    <Image Source="{Binding Path}" Width="40" Height="40" />
                                </Border>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <WrapPanel />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                </ListBox>

                <StackPanel Orientation="Horizontal" Grid.Row="1" HorizontalAlignment="Center">
                    <Button x:Name="btnSelectHair" Content="Select Hair"  Width="125" Margin="5" Click="btnSelectHair_Click" />
                    <Button x:Name="btnCancelHair" Content="Cancel" Width="125" Margin="5" Click="btnCancelHair_Click" />
                </StackPanel>
            </Grid>
        </Grid>
        
        
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
            About Screen Panel
     !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

        <Grid x:Name="AboutScreen" Grid.Row="1" Background="Transparent" Visibility="Collapsed">
            <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Fill="#CC000000" />
            
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <StackPanel Grid.Row="0">
                    <Label Content="TSGE" Foreground="Chartreuse" FontSize="72" Margin="25,25,25,0" />
                    <Label Content="Terraria Save Game Editor" FontStyle="Italic" Foreground="DarkGray" Margin="75,-15,0,0" />
                    <Label x:Name="lblAboutVersion" Content="Version: v1.0.0.0" Foreground="CornflowerBlue" Margin="40,0,0,0" />
                    <Label Content="Coded by: atom0s" Foreground="GreenYellow" Margin="40,0,0,0"  />
                </StackPanel>
                
                <StackPanel Grid.Row="1">
                    <Label Content="Thanks To:" Foreground="DeepPink" FontSize="32" Margin="25,25,25,0" />
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="Tim Heuer" Foreground="White" />
                        <Label>
                            <Hyperlink Foreground="CornflowerBlue" NavigateUri="http://timheuer.com/blog/archive/2010/09/09/silverlight-jetpack-theme-released.aspx" RequestNavigate="Hyperlink_RequestNavigate">Original JetPack Theme</Hyperlink>
                        </Label>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="Jonathan Antoine" Foreground="White" />
                        <Label>
                            <Hyperlink Foreground="CornflowerBlue" NavigateUri="http://blog.lexique-du-net.com/index.php?post/2011/06/13/Amazing-WPF-Controls-/-JetPack-Theme-updated-!" RequestNavigate="Hyperlink_RequestNavigate">JetPack Theme Converted To WPF</Hyperlink>
                        </Label>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="Greg Beech" Foreground="White" />
                        <Label>
                            <Hyperlink Foreground="CornflowerBlue" NavigateUri="http://stackoverflow.com/a/248613" RequestNavigate="Hyperlink_RequestNavigate">Natrual Sorting Implementation</Hyperlink>
                        </Label>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="TerrariViewer" Foreground="White" />
                        <Label>
                            <Hyperlink Foreground="CornflowerBlue" NavigateUri="http://terrariviewer.codeplex.com" RequestNavigate="Hyperlink_RequestNavigate">Model Viewer Concept</Hyperlink>
                        </Label>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="Silk Icons" Foreground="White" />
                        <Label>
                            <Hyperlink Foreground="CornflowerBlue" NavigateUri="http://www.famfamfam.com/lab/icons/silk/" RequestNavigate="Hyperlink_RequestNavigate">Menu Icons</Hyperlink>
                        </Label>
                    </StackPanel>

                    <StackPanel Orientation="Horizontal" Margin="50,20,0,0">
                        <Label Content="Sinzfeldt" Foreground="White" />
                        <Label Content="For buying me Terraria." Foreground="Chartreuse" />
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="50,0,0,0">
                        <Label Content="attilathedud" Foreground="White" />
                        <Label Content="For beta testing." Foreground="Chartreuse" />
                    </StackPanel>
                </StackPanel>

                <Grid Grid.Row="2" HorizontalAlignment="Left" VerticalAlignment="Bottom" Margin="15">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="/tsge;component/Icons/Twitter.png" Stretch="None" />
                        <Label VerticalAlignment="Center">
                            <Hyperlink NavigateUri="https://twitter.com/#!/atom0s" RequestNavigate="Hyperlink_RequestNavigate" Foreground="LightSkyBlue">Follow me on Twitter!</Hyperlink>
                        </Label>
                    </StackPanel>
                </Grid>

                <Button x:Name="btnAboutClose" Grid.Row="2" Content="Close" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="15" Width="100" Click="btnAboutClose_Click" />
            </Grid>
        </Grid>
        
        
    </Grid>
</Window>
